<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Admin  Login</title>

	<link href="css/login.css" rel="stylesheet" type="text/css">

</head>

<body class="login">
<div class="login_logo" style="margin-top:68px; font-size:30px; color:#1e65a8;"> 竞赛后台管理系统

</div>
<div class="login_m">
	<div class="login_boder">
		<div class="login_padding">
			<h2>用户名</h2>
			<label>
				<input type="text" id="username" class="txt_input txt_input2">
			</label>
			<h2>密码</h2>
			<label>
				<input type="password" name="textfield2" id="userpwd" class="txt_input">
			</label>
			<div class="rem_sub">
				<label>
					<input type="submit" class="sub_button" name="button" id="button" value="登录" style="opacity: 0.7;">
				</label>
			</div>
		</div>
	</div><!--login_boder end-->
</div><!--login_m end-->

<br />
<br />
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	$(function () {
		$("#button").click(function () {
			//获取输入的用户的密码和账号
			var username=$("#username").val();
			var userpwd=$("#userpwd").val();
			console.log(username);
			//发起请求
			$.post(
							"http://localhost:8080/competitions/rootLogin.do",
							{uname:username,upass:userpwd},
							function (data) {
								if (data.responseCode===500){
									alert("登录失败")
								}else {
									location.href="private/index.html"
								}
							}
			)

		})
	})
</script>
</body>
</html>
